package com.mbti.youmore.service;

import com.mbti.youmore.common.exception.UserAlreadyExistsException;
import com.mbti.youmore.common.exception.UserNotExistsException;
import com.mbti.youmore.entity.User;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;

/**
 * @author Guqier
 * @version 1.0
 * @date 2024/5/8 下午8:41
 */
public interface AuthService {
    @Transactional // 启用事务
    User register(User user) throws UserAlreadyExistsException, IOException;

    @Transactional
    User login(User user) throws UserNotExistsException;

    @Transactional
    boolean logout(Integer userId);
}
